# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: team/kde <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-frameworks-old
pkgname=syntax-highlighting5
pkgver=5.115.0
pkgrel=1
pkgdesc="Syntax highlighting engine for structured text and code"
arch="all !armhf" # armhf blocked by extra-cmake-modules
url="https://community.kde.org/Frameworks"
license="MIT"
depends_dev="
	qt5-qtbase-dev
	qt5-qtdeclarative-dev
	qt5-qtxmlpatterns-dev
	"
makedepends="$depends_dev
	doxygen
	extra-cmake-modules
	qt5-qttools-dev
	samurai
	"
_repo_url="https://invent.kde.org/frameworks/syntax-highlighting.git"
source="https://download.kde.org/stable/frameworks/${pkgver%.*}/syntax-highlighting-$pkgver.tar.xz
	fix-pcre.patch
	"
subpackages="$pkgname-dev $pkgname-doc $pkgname-lang"
builddir="$srcdir/syntax-highlighting-$pkgver"

replaces="syntax-highlighting<=5.110.0-r0"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_QCH=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
6a25a6c3be6258e956663065864ec177d05d91c817e79922ba599e45d4738813746a7c751c5043135d2c7255d341a60a6152e1d02ad90136e00a97ecb2ecd479  syntax-highlighting-5.115.0.tar.xz
29befce7098f5fad53673bf01693d67d590fc6f55dae8c28773d1fc2e688004688bbac6be2117ed2bef84cfd0d0a6887246056591647d3d613f3da701be1d313  fix-pcre.patch
"
